package com.coreJava.设计模式.JDK动态代理;

import java.lang.reflect.Proxy;

/**
 * 作者: LCG
 * 日期: 2019/9/4 16:59
 * 描述:
 */
public class TesDongTai {

    public static void main(String[] args) {

        Class<?>[] interfaces = DongTaiInterfaceImpl.class.getInterfaces();
        DongTaiInterface dongTaiInterface1=new DongTaiInterfaceImpl();
        MyInvocationHandler myInvocationHandler=new MyInvocationHandler(dongTaiInterface1);
        DongTaiInterface dongTaiInterface = (DongTaiInterface)Proxy.newProxyInstance(DongTaiInterface.class.getClassLoader(), interfaces, myInvocationHandler);

        dongTaiInterface.test01();

    }

}
